$(function(){
    $(".btn-active").click(function (event) {
        event.preventDefault()
        $this = $(this)
        is_active=parseInt($this.attr("data-is_active"))
        user_id = parseInt(($this.attr("data-user-id")))
        data = {
            "is_active":is_active?0:1,
            "user_id":user_id
        }
        $.ajax({
            url:"/cms/front_user",
            data:data,
            method:"PUT",
            success:function (res) {
                alert("修改成功")
                console.log(is_active,user_id)
                window.location.reload()
            },
            fail:function (err) {
                alert(err)
            }
        })
    })
})